package com.itheima.thread.utils.countdownlatch.demo01;

import java.util.concurrent.CountDownLatch;

public class CountDownLatchThread01 implements Runnable {

    private CountDownLatch countDownLatch;
    public CountDownLatchThread01(CountDownLatch countDownLatch) {
        this.countDownLatch = countDownLatch;
    }

    @Override
    public void run() {

        try {
            Thread.sleep(5000);
            System.out.println("5秒以后执行了CountDownLatchThread01.....");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        countDownLatch.countDown();
    }
}
